#ifndef _NAND_H_
	#define _NAND_H_
#include "def.h"
#include "os_cpu.h"

#define	NFMAXBLOCKS	4096
#define NFBLOCKSIZE 16384  //32*512
#define NFPAGESIZE 512

void InitNandCfg(void);
U32 WaitNFBusy(void);
U32 ReadChipId(void);
U16 ReadStatus(void);
U32 EraseBlock(U32 addr);
//void ReadPage(U32 addr, U8 *buf);
U32 ReadPage(U32 addr, U8 *buf);
U32 WritePage(U32 addr, U8 *buf);
void MarkBadBlk(U32 addr);
int CheckBadBlk(U32 addr);
void InitNandFlash(void);
//unsigned short NF_WriteBufToBlock(void);
INT32S NF_WriteBufToBlock(void);
//void fs_readpage(unsigned long Sector,void *pBuffer);
U32	fs_readpage(unsigned long Sector,void *pBuffer);
//void fs_writepage(unsigned long Sector,void *pBuffer);
U32	fs_writepage(unsigned long Sector,void *pBuffer);


#endif